﻿@model PagedList.IPagedList<TireStore.Models.Product>
@using PagedList
@using PagedList.Mvc
@using TireStore.Helpers


<div class="row-fluid">
                <div class="span3">
                    <div style="margin-top: 18px;">
                        Tổng số sản phẩm: <span style='color: #A52A2A;'>40</span> / <span style='color: #333;'>100</span>
                    </div>
                </div>
                <div class="span9 pagination pagination-small pagination-right">
                    @Html.PagedListPager(Model, page => Url.Action("Index", new { page = page }), (PagedListRenderOptions)ViewBag.CustomPage)
                </div>
            </div>
            <div>
                <table class="table table-striped table-bordered dataTable table-hover" cellspacing="0" id="cph_Main_ctl00_ctl00_grvProducts" style="border-collapse: collapse;">
                    <tr>
                        <th scope="col">
                            <input id="chkAll" type="checkbox" name="chkAll" onclick="javascript: SelectAllCheckboxes(this);" />
                        </th>
                        <th scope="col">Ảnh</th>
                        <th scope="col">Mã sản phẩm</th>
                        <th scope="col">Tên sản phẩm</th>
                        <th scope="col">Giá</th>
                        <th scope="col">Giá khuyến mại</th>
                        <th scope="col">Trạng thái</th>
                        <th scope="col">Thứ tự</th>
                        <th scope="col">Kho hàng</th>
                        <th scope="col">Thao tác</th>
                    </tr>
                    @foreach (var item in Model)
                    {
                        <tr class="row1">
                            <td align="center" style="width: 8px;">
                                <input id="chkEdit" type="checkbox" name="chkEdit" />
                                <input type="hidden" name="hdEdit" id="hdEdit" value="@item.Id" />
                            </td>
                            <td class="text-center thumb-image" align="center" style="width: 30px;">
                                <img src="http://media.bizwebmedia.net/Thumbnails//Templates/Images/2012/6/16385892312201113305164.30.30.jpg" onerror="this.src='http://media.bizwebmedia.net/Thumbnail.ashx?img=/Templates/Images/2012/6/16385892312201113305164.jpg&width=30&height=30';"
                                product-name="@item.Name"
                                thumbnail="http://media.bizwebmedia.net/Thumbnails//Templates/Images/2012/6/16385892312201113305164.350.300.jpg"
                                thumbnail-error="http://media.bizwebmedia.net/Thumbnail.ashx?img=/Templates/Images/2012/6/16385892312201113305164.jpg&width=350&height=300"
                                alt="@item.Name" />
                            </td>
                            <td class="Code" align="center" style="width: 80px;">
                                <input type="text" id="txtCode" style="width: 70px; text-align: left;" value="@item.Code"
                                onchange="javascript:return UpdateProduct2(@item.Id);" />
                            </td>
                            <td>
                                <a href="../Product/Edit/@item.Id">@item.Name</a>
                            </td>
                            <td class="Price" align="center" style="width: 90px;">
                                <input type="text" id="txtPrice" style="width: 75px; text-align: right;" value="@item.Price"
                                onkeypress="javascript:return keypress(event);"
                                onchange="javascript:return UpdateProduct2(@item.Id);" />
                            </td>
                            <td class="SalePrice" align="center" style="width: 70px;">
                                <input type="text" id="txtSalePrice" style="width: 75px; text-align: right;" value="0"
                                onkeypress="javascript:return keypress(event);"
                                onchange="javascript:return UpdateProduct2(@item.Id);" />
                                <input type="hidden" />
                            </td>
                            <td class="Status" align="center" style="width: 95px;">
                                <select id="ddlStatus" style="width: 95px; text-align: left;" onchange="javascript:return UpdateProduct2(4821018);">
                                    <option value="allow" selected="selected">Đang bán</option>
                                    <option value="disallow">Chỉ hiển thị</option>
                                    <option value="disallowandtext">Hiển thị chữ thay thế</option>
                                </select>
                            </td>
                            <td class="OrderNumber" align="center" style="width: 45px;">
                                <input type="text" id="txtOrderNumber" style="width: 30px;" value="@item.MIindex" onchange="javascript:return UpdateProduct2(@item.Id);" />
                            </td>
                            <td style="width: 80px;">
                                <div style="display: none" onmouseout="HideQuickHelp(this)" onmouseover="ShowQuickHelp(this, 'Tình trạng kho hàng', 'Số lượng hiện tại: 0&lt;br /&gt;Cảnh báo khi số lượng còn: 0')"
                                    class="StockLevel">
                                    <span style="width: 0%;" class="InStock"></span>
                                </div>
                            </td>
                            <td class="text-center" align="center" style="width: 100px;">
                                <a href="../Product/Edit/@item.Id" class="action-link-button" id="lbtUpdateProduct"
                                    title="Chỉnh sửa sản phẩm này"><i class="icon-edit"></i></a>
                                <a href="javascript:deleteProduct(@item.Id);" class="action-link-button" onclick=""
                                id="lbChangeVisible4821018" productid="@item.Id" st="open" title='Hiển thị'>
                                    <i class='icon-remove'></i>
                                </a>
                            </td>
                        </tr>
                    }
                </table>
            </div>
            <div class="row-fluid">
                <div class="span3">
                </div>
                <div class="span9 pagination pagination-small pagination-right">
                    @Html.PagedListPager(Model, page => Url.Action("Index", new { page = page }), (PagedListRenderOptions)ViewBag.CustomPage)
                </div>
            </div>